Skip to content

Antalya 25.8 Backport of #92250 - Reduce INSERT/merges memory usage with wide parts for very wide tables by enabling adaptive write buffers - #2166

Open
mkmkme wants to merge 1 commit into
antalya-25.8from
backports/antalya-25.8/92250
Open

Antalya 25.8 Backport of #92250 - Reduce INSERT/merges memory usage with wide parts for very wide tables by enabling adaptive write buffers#2166
mkmkme wants to merge 1 commit into
antalya-25.8from
backports/antalya-25.8/92250

Conversation

@mkmkme

@mkmkme mkmkme commented Aug 5, 2026

Copy link
Copy Markdown
Collaborator

25.8.15 Backport of ClickHouse#92250 - Reduce INSERT/merges memory usage with wide parts for very wide tables by enabling adaptive write buffers

Same as #1341, but for Antalya 25.8

Changelog category (leave one):

  • Performance Improvement

Changelog entry (a user-readable short description of the changes that goes to CHANGELOG.md):

Reduce INSERT/merges memory usage with wide parts for very wide tables by enabling adaptive write buffers. Add support of adaptive write buffers for encrypted disks (ClickHouse#92250 by @azat)

Documentation entry for user-facing changes

...

CI/CD Options

Exclude tests:

  • Fast test
  • Integration Tests
  • Stateless tests
  • Stateful tests
  • Performance tests
  • Aarch64 tests
  • All with ASAN
  • All with TSAN
  • All with MSAN
  • All with UBSAN
  • All with Coverage
  • All Regression
  • Disable CI Cache

Regression jobs to run:

  • Fast suites (mostly <1h)
  • Aggregate Functions (2h)
  • Alter (1.5h)
  • Benchmark (30m)
  • ClickHouse Keeper (1h)
  • Iceberg (2h)
  • LDAP (1h)
  • OAuth (5m)
  • Parquet (1.5h)
  • RBAC (1.5h)
  • SSL Server (1h)
  • S3 (2h)
  • S3 Export (2h)
  • Swarms (30m)
  • Tiered Storage (2h)

25.8.15 Backport of ClickHouse#92250 - Reduce INSERT/merges memory usage with wide parts for very wide tables by enabling adaptive write buffers
@mkmkme mkmkme added antalya backport Backport antalya-25.8 25.8 25.8 Altinity Stable labels Aug 5, 2026
@github-actions

github-actions Bot commented Aug 5, 2026

Copy link
Copy Markdown

Workflow [PR], commit [1fedca7]

@mkmkme

mkmkme commented Aug 5, 2026

Copy link
Copy Markdown
Collaborator Author

Couldn't run the tests locally because I'm testing with debug by default and the test has an explicit no-debug in it. Will rely on the CI. But the PR landed without any issues, so I don't expect anything to go wrong. Will self-verify once CI finishes

@mkmkme

mkmkme commented Aug 6, 2026

Copy link
Copy Markdown
Collaborator Author

@blau-ai

@blau-ai

blau-ai commented Aug 6, 2026

Copy link
Copy Markdown
Collaborator

CI triage — 4 real failures, 0 caused by this PR

Verdict: All failing checks are either pre-existing/environmental (Iceberg & Swarms regression suites) or a flaky AST-fuzzer finding unrelated to this change. This PR touches only the MergeTree wide-part write-buffer / encrypted-disk write path; none of the failing tests exercise that path. The core suites that do — Fast test, all Stateless (incl. this PR's new 03770_min_columns_to_activate_adaptive_write_buffer), Stateful, Integration (5/5), Stress, BuzzHouse, all Builds — are green. PR and FinishCIReport are aggregate gates, red only because of the checks below.

Check Class PR-caused?
Regression x86 iceberg_1 / iceberg_2 pre-existing ❌ No
Regression x86 swarms pre-existing ❌ No
AST fuzzer (amd_debug) flaky ❌ No
PR, FinishCIReport aggregate gate ❌ No (downstream)

1. Regression iceberg_1 / iceberg_2 / swarms — pre-existing

Decisive log excerpts:

  • iceberg_1: [ Fail ] /iceberg/iceberg engine/rest catalog/position delete reads and [ Error ] /iceberg/iceberg engine/rest catalog/sort key timezone
  • iceberg_2: [ Fail ] /iceberg/.../glue catalog/position delete reads, .../feature/position delete smoke, .../feature/compaction smoke
  • swarms: [ Fail ] /swarms/feature/node failure/check restart swarm node

Evidence it's not this PR: sibling PR #2168 (an unrelated backport — "Fix crash in StorageDistributed when parsing malformed shard directory names", no MergeTree write changes) has the identical three failuresRegression x86 iceberg_1 (1 module errored), iceberg_2 (1 module failed), swarms (1 module failed) — in the same run batch. These are Iceberg catalog / position-delete / compaction and swarm node-failure features; they read external Iceberg tables and test distributed swarm restarts, and never go through the wide-part adaptive write buffer this PR modifies.

Next step: safe to ignore for this PR — track separately as flaky/broken regression suites on antalya-25.8.

2. AST fuzzer (amd_debug) — flaky

Decisive excerpt: Logical error: 'Unexpected return type from materialize. Expected String. Got Nullable(...)'.

This is a type-deduction assertion inside FunctionMaterialize on a fuzzer-mutated query — pure query-execution, no disk write, nothing to do with write buffers. The AST fuzzer randomly mutates existing test queries, so it hits different latent issues each run: the same sibling PR #2168's AST fuzzer passed (OK). This matches the known upstream class ClickHouse#107951 ("AST-fuzzer-internal-path: assertions on type-invalid inputs the analyzer normally rejects").

Next step: re-run the AST fuzzer (amd_debug) job; it should go green. It is not a blocker for this backport.


Health check

The change is a clean backport of upstream ClickHouse#92250: it adds the min_columns_to_activate_adaptive_write_buffer MergeTree setting (default 500) plus a SettingsChangesHistory entry, threads use_adaptive_write_buffer / adaptive_write_buffer_initial_size through WriteBufferFromEncryptedFile (with the growth logic in nextImpl), and updates the two gtest call sites for the new constructor signature. All directly-relevant CI — builds, fast/stateless/stateful/integration/stress/BuzzHouse and the newly added stateless test — is passing, so the change looks safe to merge once the pre-existing regression suites are dispositioned. No code changes needed from my side.

@blau-ai, evidence-first from CI (I can't build/run ClickHouse locally).

@mkmkme mkmkme added the verified Approved for release label Aug 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

25.8 25.8 Altinity Stable antalya antalya-25.8 backport Backport verified Approved for release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants